/**
 * This file is Copyright © 2008 Software Craftsmen Limited. All Rights Reserved.
 */
package com.softwarecraftsmen.collections.maps;

import com.softwarecraftsmen.collections.Key;
import com.softwarecraftsmen.collections.MutableCollection;
import com.softwarecraftsmen.collections.tuples.Pair;
import org.jetbrains.annotations.NotNull;

public interface MutableMap<K extends Key, V> extends Map<K, V>, MutableCollection<K, V>
{
	// This is actually the commonest need
	// Should it return a boolean (of our type) or should it throw an exception?
	void putIfNotPresent(final @NotNull K key, final @NotNull V value);

	// This is actually the commonest need
	// Should it return a boolean (of our type) or should it throw an exception?
	void putIfNotPresent(final @NotNull Pair<K, V> entry);

	// Second commonest
	void putOrReplace(final @NotNull K key, final @NotNull V value);

	// Second commonest
	void putOrReplace(final @NotNull Pair<K, V> entry);
}
